Skip to content

feat: Full/Selective/OnDemand skill deployment modes#5

Merged
modpunk merged 3 commits intomainfrom
feat/skill-deployment-modes
Apr 1, 2026
Merged

feat: Full/Selective/OnDemand skill deployment modes#5
modpunk merged 3 commits intomainfrom
feat/skill-deployment-modes

Conversation

@modpunk
Copy link
Copy Markdown
Owner

@modpunk modpunk commented Apr 1, 2026

Summary

Implements three skill deployment modes from the Expert Skill Forge design doc (Section 9.3).

Deployment Modes

  • Full (default): All assigned skills loaded at startup. Best for agents with 5 or fewer skills.
  • Selective: Only prompt_context sections matching capability keywords. For agents with many skills.
  • OnDemand: Nothing at startup. Skills resolved per-task by keyword matching against name/tags/tools/description.

Files Changed

  • crates/openfang-types/src/agent.rs - SkillDeploymentMode enum, SkillCapabilityFilter, skill_deployment field
  • crates/openfang-skills/src/deployment.rs - New: SkillDeployer resolver
  • crates/openfang-skills/src/lib.rs - Register deployment module
  • crates/openfang-kernel/src/kernel.rs - Wire build_skill_summary and collect_prompt_context to SkillDeployer

Backward Compatible

Defaults to Full mode. Existing agents work unchanged.

Tests

22 total: 14 in deployment.rs (keyword matching, section filtering, caps), 8 in agent.rs (serde, TOML, defaults).

modpunk added 3 commits April 1, 2026 12:08
Adds three deployment modes for controlling how skills are loaded into agent context:

- Full (default): All assigned skills loaded at startup. Best for agents with ≤5 skills.
- Selective: Only specific capabilities from each skill, filtered by keyword matching against prompt_context markdown sections.
- OnDemand: Nothing injected at startup. Skills resolved per-task by matching user message against skill trigger descriptions (name, tags, tools, description).

Changes:
- openfang-types/agent.rs: Add SkillDeploymentMode enum, SkillCapabilityFilter struct, skill_deployment field on AgentManifest
- openfang-skills/deployment.rs: New module with SkillDeployer resolver (summary builder, context collector, on-demand keyword matcher)
- openfang-skills/lib.rs: Register deployment module
- openfang-kernel/kernel.rs: Wire build_skill_summary() and collect_prompt_context() to delegate to SkillDeployer based on deployment mode

Backward compatible — SkillDeploymentMode defaults to Full, preserving existing behavior for all agents that don't specify a deployment mode.
Fixes CI: f32 doesn't implement Eq. SkillDeploymentMode now derives PartialEq only.

Wires resolve_on_demand() into both run_agent_loop() and run_daemon_agent_loop():
- Pattern-matches manifest.skill_deployment for OnDemand variant
- Takes SkillRegistry snapshot, filters by agent skill allowlist
- Calls SkillDeployer::resolve_on_demand() with user message
- Injects matched skill prompt_context into system_prompt for this turn
- External skills wrapped in trust boundary
- Logs matched skills at info level
Adds SkillDeploymentMode::default() to every explicit AgentManifest struct
literal that doesn't use ..Default::default() spread:
- kernel.rs: 2 test helpers
- wizard.rs: agent creation wizard
- registry.rs: test helper
@modpunk modpunk merged commit f64068d into main Apr 1, 2026
6 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant